package com.lemontree.spring.aoptalk;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;

public class ThrowAop implements ThrowsAdvice {

    //定义增强逻辑
    public void afterThrowing(Method method,Object[] args,Object target,Exception ex)throws Throwable{
        System.out.println("方法名"+method.getName());
        System.out.println("异常名称"+ex.getMessage());
        System.out.println("回滚一波~~~~~");
    }

}
